﻿<?xml version="1.0" encoding="utf-8"?>
<!--<xs:schema id="data"
    targetNamespace="http://sdn.com/data.xsd"
    elementFormDefault="qualified"
    xmlns="http://sdn.com/data.xsd"
    xmlns:mstns="http://sdn.com/data.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <!-- Definitions -->
  
  <xs:element name="In">
    <xs:complexType mixed="true">
      <xs:attribute name ="Sum" type="xs:decimal" use ="required" />
    </xs:complexType>
  </xs:element>
  
  <xs:element name="Out">
    <xs:complexType mixed="true">
      
      <xs:attribute name ="Sum" type="xs:decimal" use ="required" />
      
      <xs:attribute name ="Target" use ="required">
        <xs:simpleType>
          <xs:restriction base ="xs:string">
            <xs:enumeration value="Other"/>
            <xs:enumeration value="Common"/>
            <xs:enumeration value="Me"/>
            <xs:enumeration value="Lena"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      
      <xs:attribute name ="Type" use ="required">
        <xs:simpleType>
          <xs:restriction base ="xs:string">
            <xs:enumeration value="Other"/>
            <xs:enumeration value="Products"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      
    </xs:complexType>
  </xs:element>

  <xs:element name="Outs" >
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Out" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name ="Sum" type="xs:decimal" use ="required" />
      <xs:attribute name ="Place" type="xs:string" use ="required" />
    </xs:complexType>
  </xs:element>

  <!-- /Definitions -->
  
  
  <xs:element name="Accounting">
    <xs:complexType>
      <xs:sequence>

        <xs:element name="Day" maxOccurs="unbounded">
          <xs:complexType>
            <xs:choice maxOccurs="unbounded">

              <xs:element ref="In"/>

              <xs:element ref="Out"/>

              <xs:element ref="Outs"/>

            </xs:choice>

            <xs:attribute name ="Date" type="xs:date" use ="required" />
            <xs:attribute name ="Start" type="xs:decimal" use ="required" />
            <xs:attribute name ="End" type="xs:decimal" use ="required" />
            <xs:attribute name ="InSum" type="xs:decimal" use ="required" />
            <xs:attribute name ="OutSum" type="xs:decimal" use ="required" />

          </xs:complexType>
        </xs:element>

      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
